#include <iostream>
#include "BinaryLinkTree.h"
#include <cstring>

struct Student
{
    Student(int id,const std::string& name):id(id),name(name){}
    int id;
    std::string name;
};

void ShowStudent(void *p)
{
    Student *s = (Student *)p;
    std::cout<<s->id<<" "<<s->name<<std::endl;
}

int main()
{
    BLTree tree;
    tree.SetShowtype(ShowStudent);
    tree.Insert(new Student(2,"zhangsan"));
    tree.Insert(new Student(1,"lisi"));
    tree.Insert(new Student(3,"wangwu"));
    tree.Insert(new Student(4,"liming"));
    tree.show();

    // tree.Insert((void*)1);
    // tree.Insert((void*)2);
    // tree.Insert((void*)3);
    // tree.Insert((void*)4);
    // tree.Insert((void*)5);
    // tree.Insert((void*)6);
    // tree.show();
    // // tree.Remove(6);
    // // tree.Remove(5);
    
    // ElementType c = tree.FindNode((void*)2); //二叉树不允许改值
    // std::cout<<(void*)c<<std::endl;          //按值找地址
    // printf("%p %p",c,tree.FindNode((void*)2));
    
    return 0;
}